package com.example.librarymanagement.dto.reader;

import com.example.librarymanagement.entity.Reader;
import com.example.librarymanagement.util.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
import java.util.Date;

/**
 * @author ZHB
 */

@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class ReaderAddDto extends BaseDto<Reader> {

    @ApiModelProperty(value = "用户名", required = true)
    @NotNull(message = "用户名不能为空")
    private Integer userId;

    @ApiModelProperty(value = "读者姓名", required = true)
    @NotBlank(message = "读者姓名不能为空")
    private String name;

    @ApiModelProperty(value = "读者性别", required = true)
    @NotNull(message = "性别不能为空")
    private Integer sex;

    @ApiModelProperty(value = "所属单位")
    private String affiliatedUnit;

    @ApiModelProperty(value = "身份证号", required = true)
    @NotBlank(message = "身份证号不能为空")
    private String idCard;

    @ApiModelProperty(value = "出生日期")
    private Timestamp birthday;

}
